<template>
  <div class="header-main-pc">
    <div class="header-left">
      <a href="/" class="header-leftT">OPPO</a>
      <a class="header-title" v-for="(item,index) in titleList.slice(0, 3)" :key="index" @click="handleClick">
        {{item}}
      </a>
    </div>
    <div class="header-right">
      <a class="header-title" v-for="(item,index) in titleList.slice(3, 6)" :key="index">
        {{item}}
      </a>
      <div class="search">
        <img src="../../public/head.png" alt="" />
        <el-input v-model="input" type="text" placeholder="搜索" />
      </div>
      <img src="../../public/head.png" alt="" class='head' />
      <img src="../../public/head.png" alt="" class='head2' />
    </div>
  </div>
  <div style="height: 52px;"></div>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router';
const router = useRouter();
const titleList = [
  "OPPO产品",
  "一加产品",
  "关于OPPO",
  "ColorOS",
  "官方商城",
  "服务",
  "企业业务"
];

const input = ref('')
const handleClick = () =>{
    router.push('/list');
}
</script>
<style scoped lang="scss">
.header-main-pc {
  height: 52px;
  background-color: #fff;
  border-bottom: 1px solid #ececec;
  padding: 0 64px;
  display: flex;
  justify-content: space-between;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  .header-left {
    display: flex;
    align-items: center;
    height: 100%;
    .header-leftT {
      font-size: 24px;
      font-weight: 600;
      color: #333;
      text-decoration: none;
      margin-right: 26px;
    }
  }
  .header-right {
    display: flex;
    align-items: center;
    .head {
      border-radius: 50%;
      height: 24px;
      width: 24px;
    }
    .head2 {
      border-radius: 50%;
      height: 24px;
      width: 24px;
      margin-left: 4px;
    }
    .search {
      background: #f6f6f6;
      border-radius: 32px;
      margin: 0 16px 0 8px;
      padding: 8px 12px;
      z-index: 40;
      display: flex;
      align-items: center;
      img {
        width: 16px;
        height: 16px;
      }
      ::v-deep .el-input__wrapper {
        border: 0;
        background: #f6f6f6;
        color: #000;
        font-size: 12px;
        height: 20px;
        line-height: 20px;
        outline: 0;
        padding: 0 0 0 5px;
        width: 185px;
        box-shadow: none;
      }
    }
    
  }
  .header-title {
      color: #0000008c;
      display: block;
      font-size: 14px;
      line-height: 52px;
      padding: 0 12px;
      white-space: nowrap;
      cursor: pointer;
      &:hover {
        color: #007aff;
      }
    }
}
</style>